#include<iostream>



class Base
{
public:
    static int GetNum()
    {
        return a;//静态变量
    }

    static void add()
    {
        a++;
    }
protected:
    static int a;
};

int Base::a = 10;

class Derived : public Base
{
public:
    static int GetNum()
    {
        return a;
    }
};



int main()
{
    Derived d;
    Base::add();
    std::cout<<d.GetNum()<<std::endl;
    d.add();
    std::cout<<Base::GetNum()<<std::endl;
    std::cout<<d.GetNum()<<std::endl;
    return 0;
}
